<template>
	<div class="app-container calendar-list-container">
		<div class="filter-container">
			<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="城市代码" v-model.trim="orderCancel.city"> </el-input>
			<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="医院订单号" v-model.trim="orderCancel.outTradeNo"> </el-input>
			<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="业务流水号" v-model.trim="orderCancel.serialNo"> </el-input>
			<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="支付宝帐户ID" v-model.trim="orderCancel.userId"> </el-input>
			<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
		</div>
		<el-table :key='tableKey' :data="list" v-loading.body="listLoading" border fit highlight-current-row style="width: 100%">
			<el-table-column type="index" label="序号" header-align="center" align="center" width="65">
				<template scope="scope"><span>{{scope.$index+(orderCancel.page - 1) * orderCancel.limit + 1}} </span></template>
			</el-table-column>
			<!--			<el-table-column width="200px" align="center" label="">
				<template scope="scope">
					<span>{{scope.row.id}}</span>
				</template>
			</el-table-column>
		-->
			<el-table-column align="center" label="流水号" width="200">
				<template scope="scope">
					<span>{{scope.row.outOrderNo}}</span>
				</template>
			</el-table-column>
			<!--
			<el-table-column width="200px" align="center" label="">
				<template scope="scope">
					<span>{{scope.row.city}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="">
				<template scope="scope">
					<span>{{scope.row.cityCode}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="">
				<template scope="scope">
					<span>{{scope.row.channel}}</span>
				</template>
			</el-table-column>-->
			<el-table-column width="200px" align="center" label="医院订单号">
				<template scope="scope">
					<span>{{scope.row.outTradeNo}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="业务流水号">
				<template scope="scope">
					<span>{{scope.row.serialNo}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="单据号">
				<template scope="scope">
					<span>{{scope.row.billNo}}</span>
				</template>
			</el-table-column>
			<!--			<el-table-column width="200px" align="center" label="">
				<template scope="scope">
					<span>{{scope.row.orgNo}}</span>
				</template>
			</el-table-column>-->
			<el-table-column width="200px" align="center" label="社保卡ID">
				<template scope="scope">
					<span>{{scope.row.medicalCardId}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="社保卡号">
				<template scope="scope">
					<span>{{scope.row.medicalCardNo}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="支付宝用户ID">
				<template scope="scope">
					<span>{{scope.row.userId}}</span>
				</template>
			</el-table-column>
			<!--			<el-table-column width="200px" align="center" label="">
				<template scope="scope">
					<span>{{scope.row.requestContent}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="">
				<template scope="scope">
					<span>{{scope.row.totalAmount}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="">
				<template scope="scope">
					<span>{{scope.row.gmtOutCreate}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="">
				<template scope="scope">
					<span>{{scope.row.extendParams}}</span>
				</template>
			</el-table-column>-->
			<!--			<el-table-column width="200px" align="center" label="请求时间">
				<template scope="scope">
					<span>{{scope.row.reqTime}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="结果返回时间">
				<template scope="scope">
					<span>{{scope.row.resultTime}}</span>
				</template>
			</el-table-column>-->
			<el-table-column width="200px" align="center" label="状态">
				<template scope="scope">
					<span>{{scope.row.resultStats}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="错误码代码">
				<template scope="scope">
					<span>{{scope.row.resultCode}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="错误描述">
				<template scope="scope">
					<span>{{scope.row.resultMessage}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="错误详细描述">
				<template scope="scope">
					<span>{{scope.row.resultDescription}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="订单金额">
				<template scope="scope">
					<span>{{scope.row.resultTotalAmount}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="医保支付">
				<template scope="scope">
					<span>{{scope.row.resultInsuranceAmount}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="现金支付">
				<template scope="scope">
					<span>{{scope.row.resultSelfpayAmount}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="时间">
				<template scope="scope">
					<span>{{scope.row.resultGmtPayment}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="结算流水">
				<template scope="scope">
					<span>{{scope.row.payNo}}</span>
				</template>
			</el-table-column>
			<!--			<el-table-column width="200px" align="center" label="">
				<template scope="scope">
					<span>{{scope.row.flg1}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="">
				<template scope="scope">
					<span>{{scope.row.flg2}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="">
				<template scope="scope">
					<span>{{scope.row.flg3}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="">
				<template scope="scope">
					<span>{{scope.row.flg4}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="">
				<template scope="scope">
					<span>{{scope.row.flg5}}</span>
				</template>
			</el-table-column>-->
			<!--			<el-table-column width="200px" align="center" label="记录创建时间">
				<template scope="scope">
					<span>{{scope.row.createdTime}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="外部请求时间">
				<template scope="scope">
					<span>{{scope.row.outReqTime}}</span>
				</template>
			</el-table-column>-->
			<el-table-column fixed="right" align="center" label="操作" width="150">
				<template scope="scope">
					<el-button v-if="orderPayManager_view" size="small" type="success" @click="checkedFn(scope.row)">查看
					</el-button>
					<!--		<el-button v-if="orderPrepareManager_btn_edit" size="small" type="success" @click="handleUpdate(scope.row)">编辑
					</el-button>-->
					<!--	<el-button v-if="orderPrepareManager_btn_del" size="small" type="danger" @click="handleDelete(scope.row)">删除
					</el-button>-->
				</template>
			</el-table-column>
		</el-table>
		<div v-show="!listLoading" class="pagination-container">
			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="orderCancel.page" :page-sizes="[10,20,30, 50]" :page-size="orderCancel.limit" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination>
		</div>
		<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
			<el-form :model="form" :rules="rules" ref="form" label-width="100px">
				<!--				<el-form-item label="" prop="id">
					<el-input v-model="form.id" placeholder="请输入"></el-input>
				</el-form-item>-->
				<el-form-item label="流水号" prop="outOrderNo">
					<el-input v-model="form.outOrderNo" placeholder="请输入流水号"></el-input>
				</el-form-item>
				<el-form-item label="城市代码" prop="city">
					<el-input v-model="form.city" placeholder="请输入城市代码"></el-input>
				</el-form-item>
				<el-form-item label="城市代码" prop="cityCode">
					<el-input v-model="form.cityCode" placeholder="请输入城市代码"></el-input>
				</el-form-item>
				<el-form-item label="渠道编码" prop="channel">
					<el-input v-model="form.channel" placeholder="请输入渠道编码"></el-input>
				</el-form-item>
				<el-form-item label="医院订单号" prop="outTradeNo">
					<el-input v-model="form.outTradeNo" placeholder="请输入医院订单号"></el-input>
				</el-form-item>
				<el-form-item label="业务流水号" prop="serialNo">
					<el-input v-model="form.serialNo" placeholder="请输入业务流水号"></el-input>
				</el-form-item>
				<el-form-item label="业务单据号" prop="billNo">
					<el-input v-model="form.billNo" placeholder="请输入单据号"></el-input>
				</el-form-item>
				<el-form-item label="医疗机构编码" prop="orgNo">
					<el-input v-model="form.orgNo" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="医疗证号" prop="medicalCardId">
					<el-input v-model="form.medicalCardId" placeholder="请输入社保卡ID"></el-input>
				</el-form-item>
				<el-form-item label="外部医保卡号" prop="medicalCardNo">
					<el-input v-model="form.medicalCardNo" placeholder="请输入社保卡号"></el-input>
				</el-form-item>
				<el-form-item label="支付宝用户ID" prop="userId">
					<el-input v-model="form.userId" placeholder="请输入支付宝用户ID"></el-input>
				</el-form-item>

				<el-form-item label="入参透传体" prop="requestContent">
					<!-- <el-input v-model="form.resultDescription" placeholder="请输入错误详细描述"></el-input> -->
					<el-input type="textarea" :autosize="{ minRows: 3, maxRows: 6}" v-model="form.requestContent" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="订单总交易金额" prop="totalAmount">
					<el-input v-model="form.totalAmount" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="下单时间" prop="gmtOutCreate">
					<el-input v-model="form.gmtOutCreate" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="医保结算金额" prop="insuranceAmount">
					<el-input v-model="form.insuranceAmount" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="扩展参数" prop="extendParams">
					<el-input v-model="form.extendParams" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="请求时间" prop="reqTime">
					<el-input v-model="form.reqTime" placeholder="请输入请求时间"></el-input>
				</el-form-item>
				<el-form-item label="结果返回时间" prop="resultTime">
					<el-input v-model="form.resultTime" placeholder="请输入结果返回时间"></el-input>
				</el-form-item>
				<el-form-item label="状态" prop="resultStats">
					<el-input v-model="form.resultStats" placeholder="请输入S成功F失败"></el-input>
				</el-form-item>
				<el-form-item label="错误码代码" prop="resultCode">
					<el-input v-model="form.resultCode" placeholder="请输入错误码代码"></el-input>
				</el-form-item>
				<el-form-item label="错误描述" prop="resultMessage">
					<el-input v-model="form.resultMessage" placeholder="请输入错误描述"></el-input>
				</el-form-item>
				<el-form-item label="错误详细描述" prop="resultDescription">
					<!-- <el-input v-model="form.resultDescription" placeholder="请输入错误详细描述"></el-input> -->
					<el-input type="textarea" :autosize="{ minRows: 3, maxRows: 6}" v-model="form.resultDescription" placeholder="请输入错误详细描述"></el-input>
				</el-form-item>
				<el-form-item label="结果透传体" prop="resultRequestContent">
					<el-input type="textarea" :autosize="{ minRows: 3, maxRows: 6}" v-model="form.resultRequestContent" placeholder=""></el-input>
				</el-form-item>
				<el-form-item label="医保支付" prop="resultInsuranceAmount">
					<el-input v-model="form.resultInsuranceAmount" placeholder="请输入医保支付"></el-input>
				</el-form-item>
				<el-form-item label="现金支付" prop="resultSelfpayAmount">
					<el-input v-model="form.resultSelfpayAmount" placeholder="请输入现金支付"></el-input>
				</el-form-item>
				<el-form-item label="订单金额" prop="resultTotalAmount">
					<el-input v-model="form.resultTotalAmount" placeholder="请输入订单金额"></el-input>
				</el-form-item>
				<el-form-item label="时间" prop="resultGmtPayment">
					<el-input v-model="form.resultGmtPayment" placeholder="请输入时间"></el-input>
				</el-form-item>
				<el-form-item label="结算流水" prop="payNo">
					<el-input v-model="form.payNo" placeholder="请输入结算流水"></el-input>
				</el-form-item>
				<el-form-item label="备用1" prop="flg1">
					<el-input v-model="form.flg1" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="备用2" prop="flg2">
					<el-input v-model="form.flg2" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="备用3" prop="flg3">
					<el-input v-model="form.flg3" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="备用4" prop="flg4">
					<el-input v-model="form.flg4" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="备用5" prop="flg5">
					<el-input v-model="form.flg5" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="记录创建时间" prop="createdTime">
					<el-input v-model="form.createdTime" placeholder="请输入记录创建时间"></el-input>
				</el-form-item>
				<el-form-item label="外部请求时间" prop="outReqTime">
					<el-input v-model="form.outReqTime" placeholder="请输入外部请求时间"></el-input>
				</el-form-item>
				<el-form-item label="渠道号" prop="insCode">
					<el-input v-model="form.insCode" placeholder="请输入渠道号"></el-input>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="cancel('form')">取 消</el-button>
				<el-button v-if="dialogStatus=='create'" type="primary" @click="create('form')">确 定</el-button>
				<el-button v-if="dialogStatus=='checked'" type="primary" @click="checked('form')">确 定</el-button>
				<el-button v-else type="primary" @click="update('form')">确 定</el-button>
			</div>
		</el-dialog>
		<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisibleView">
			<el-form :model="form" :rules="rules" ref="form" label-width="100px">
				<!--				<el-form-item label="" prop="id">
					<el-input v-model="form.id" placeholder="请输入"></el-input>
				</el-form-item>-->
				<el-form-item label="流水号" prop="outOrderNo">
					<el-input v-model="form.outOrderNo" readonly></el-input>
				</el-form-item>
				<el-form-item label="城市代码" prop="city">
					<el-input v-model="form.city" readonly></el-input>
				</el-form-item>
				<el-form-item label="城市代码" prop="cityCode">
					<el-input v-model="form.cityCode" readonly></el-input>
				</el-form-item>
				<el-form-item label="渠道编码" prop="channel">
					<el-input v-model="form.channel" readonly></el-input>
				</el-form-item>
				<el-form-item label="医院订单号" prop="outTradeNo">
					<el-input v-model="form.outTradeNo" readonly></el-input>
				</el-form-item>
				<el-form-item label="业务流水号" prop="serialNo">
					<el-input v-model="form.serialNo" readonly></el-input>
				</el-form-item>
				<el-form-item label="业务单据号" prop="billNo">
					<el-input v-model="form.billNo" readonly></el-input>
				</el-form-item>
				<el-form-item label="医疗机构编码" prop="orgNo">
					<el-input v-model="form.orgNo" readonly></el-input>
				</el-form-item>
				<el-form-item label="医疗证号" prop="medicalCardId">
					<el-input v-model="form.medicalCardId" readonly></el-input>
				</el-form-item>
				<el-form-item label="外部医保卡号" prop="medicalCardNo">
					<el-input v-model="form.medicalCardNo" readonly></el-input>
				</el-form-item>
				<el-form-item label="支付宝用户ID" prop="userId">
					<el-input v-model="form.userId" readonly></el-input>
				</el-form-item>

				<el-form-item label="入参透传体" prop="requestContent">
					<!-- <el-input v-model="form.resultDescription" placeholder="请输入错误详细描述"></el-input> -->
					<el-input type="textarea" :autosize="{ minRows: 3, maxRows: 6}" v-model="form.requestContent" readonly></el-input>
				</el-form-item>
				<el-form-item label="订单总交易金额" prop="totalAmount">
					<el-input v-model="form.totalAmount" readonly></el-input>
				</el-form-item>
				<el-form-item label="下单时间" prop="gmtOutCreate">
					<el-input v-model="form.gmtOutCreate" readonly></el-input>
				</el-form-item>
				<el-form-item label="医保结算金额" prop="insuranceAmount">
					<el-input v-model="form.insuranceAmount" readonly></el-input>
				</el-form-item>
				<el-form-item label="扩展参数" prop="extendParams">
					<el-input v-model="form.extendParams" readonly></el-input>
				</el-form-item>
				<el-form-item label="请求时间" prop="reqTime">
					<el-input v-model="form.reqTime" readonly></el-input>
				</el-form-item>
				<el-form-item label="结果返回时间" prop="resultTime">
					<el-input v-model="form.resultTime" readonly></el-input>
				</el-form-item>
				<el-form-item label="状态" prop="resultStats">
					<el-input v-model="form.resultStats" readonly></el-input>
				</el-form-item>
				<el-form-item label="错误码代码" prop="resultCode">
					<el-input v-model="form.resultCode" readonly></el-input>
				</el-form-item>
				<el-form-item label="错误描述" prop="resultMessage">
					<el-input v-model="form.resultMessage" readonly></el-input>
				</el-form-item>
				<el-form-item label="错误详细描述" prop="resultDescription">
					<!-- <el-input v-model="form.resultDescription" placeholder="请输入错误详细描述"></el-input> -->
					<el-input type="textarea" :autosize="{ minRows: 3, maxRows: 6}" v-model="form.resultDescription" readonly></el-input>
				</el-form-item>
				<el-form-item label="结果透传体" prop="resultRequestContent">
					<el-input type="textarea" :autosize="{ minRows: 3, maxRows: 6}" v-model="form.resultRequestContent" readonly></el-input>
				</el-form-item>
				<el-form-item label="医保支付" prop="resultInsuranceAmount">
					<el-input v-model="form.resultInsuranceAmount" readonly></el-input>
				</el-form-item>
				<el-form-item label="现金支付" prop="resultSelfpayAmount">
					<el-input v-model="form.resultSelfpayAmount" readonly></el-input>
				</el-form-item>
				<el-form-item label="订单金额" prop="resultTotalAmount">
					<el-input v-model="form.resultTotalAmount" readonly></el-input>
				</el-form-item>
				<el-form-item label="时间" prop="resultGmtPayment">
					<el-input v-model="form.resultGmtPayment" readonly></el-input>
				</el-form-item>
				<el-form-item label="结算流水" prop="payNo">
					<el-input v-model="form.payNo" readonly></el-input>
				</el-form-item>
				<el-form-item label="备用1" prop="flg1">
					<el-input v-model="form.flg1" readonly></el-input>
				</el-form-item>
				<el-form-item label="备用2" prop="flg2">
					<el-input v-model="form.flg2" readonly></el-input>
				</el-form-item>
				<el-form-item label="备用3" prop="flg3">
					<el-input v-model="form.flg3" readonly></el-input>
				</el-form-item>
				<el-form-item label="备用4" prop="flg4">
					<el-input v-model="form.flg4" readonly></el-input>
				</el-form-item>
				<el-form-item label="备用5" prop="flg5">
					<el-input v-model="form.flg5" readonly></el-input>
				</el-form-item>
				<el-form-item label="记录创建时间" prop="createdTime">
					<el-input v-model="form.createdTime" readonly></el-input>
				</el-form-item>
				<el-form-item label="外部请求时间" prop="outReqTime">
					<el-input v-model="form.outReqTime" readonly></el-input>
				</el-form-item>
				<el-form-item label="渠道号" prop="insCode">
					<el-input v-model="form.insCode" readonly></el-input>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="cancel('form')">取 消</el-button>
				<el-button type="primary" @click="cancel('form')">确 定</el-button>
			</div>
		</el-dialog>
	</div>
</template>

<script>
	import {
		page,
		getObj,
		putObj
	} from 'api/admin/orderPay/index';
	import { mapGetters } from 'vuex';
	export default {
		name: 'orderPay',
		data() {
			return {
				form: {
					id: undefined,
					city: undefined,
					cityCode: undefined,
					channel: undefined,
					outTradeNo: undefined,
					serialNo: undefined,
					billNo: undefined,
					orgNo: undefined,
					medicalCardId: undefined,
					medicalCardNo: undefined,
					userId: undefined,
					requestContent: undefined,
					totalAmount: undefined,
					gmtOutCreate: undefined,
					insuranceAmount: undefined,
					extendParams: undefined,
					reqTime: undefined,
					resultTime: undefined,
					resultStats: undefined,
					resultCode: undefined,
					resultMessage: undefined,
					resultDescription: undefined,
					resultRequestContent: undefined,
					resultInsuranceAmount: undefined,
					resultSelfpayAmount: undefined,
					resultTotalAmount: undefined,
					resultGmtPayment: undefined,
					payNo: undefined,
					flg1: undefined,
					flg2: undefined,
					flg3: undefined,
					flg4: undefined,
					flg5: undefined,
					createdTime: undefined,
					outReqTime: undefined,
					insCode: undefined
				},
				rules: {
					/*id: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					city: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					cityCode: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					channel: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					outTradeNo: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					serialNo: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					billNo: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					orgNo: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					medicalCardId: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					medicalCardNo: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					userId: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					requestContent: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					totalAmount: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					gmtOutCreate: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					extendParams: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					reqTime: [{
							required: true,
							message: '请输入请求时间',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					resultTime: [{
							required: true,
							message: '请输入结果返回时间',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					resultStats: [{
							required: true,
							message: '请输入S成功F失败',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					resultCode: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					resultMessage: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					resultDescription: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					resultInsuranceAmount: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					resultSelfpayAmount: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					resultTotalAmount: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					resultGmtPrepare: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					payNo: [{
							required: true,
							message: '请输入结算流水号',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					flg1: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					flg2: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					flg3: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					flg4: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					flg5: [{
							required: true,
							message: '请输入',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					createdTime: [{
							required: true,
							message: '请输入记录创建时间',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					],
					outReqTime: [{
							required: true,
							message: '请输入外部请求时间',
							trigger: 'blur'
						},
						{
							min: 3,
							max: 20,
							message: '长度在 3 到 20 个字符',
							trigger: 'blur'
						}
					]*/
				},
				list: null,
				total: null,
				listLoading: true,
				orderCancel: {
					page: 1,
					limit: 10
				},
				dialogFormVisible: false,
				dialogFormVisibleView: false,
				dialogStatus: '',
				orderPayManager_view: false,
				orderPayManager_btn_edit: false,
				orderPayManager_btn_del: false,
				orderPayManager_btn_add: false,
				textMap: {
					update: '编辑',
					checked: '查看',
					create: '创建'
				},
				tableKey: 0
			}
		},
		created() {
			this.getList();
			this.orderPayManager_view = this.elements['orderPayManager:view'];
			this.orderPayManager_btn_edit = this.elements['orderPayManager:btn_edit'];
			this.orderPayManager_btn_del = this.elements['orderPayManager:btn_del'];
			this.orderPayManager_btn_add = this.elements['orderPayManager:btn_add'];
		},
		computed: {
			...mapGetters([
				'elements'
			])
		},
		methods: {
			//点击查看按钮
			checkedFn(data) {
				this.dialogStatus = 'checked';
				this.dialogFormVisibleView = true;
				console.log(data)
				this.form = data
				// this.jgAddOpton = this.form.organType
				// this.ztAddOpton = this.form.state
			},
			getList() {
				this.listLoading = true;
				page(this.orderCancel)
					.then(response => {
						this.list = response.data.rows;
						this.total = response.data.total;
						this.listLoading = false;
					})
			},
			handleFilter() {
				if(!this.orderCancel.city) {
					this.$message({
						message: '必须输入城市代码搜索！',
						duration: '2000',
						type: 'warning'
					})
					return false
				} else if (!this.orderCancel.outTradeNo && !this.orderCancel.serialNo && !this.orderCancel.userId) {
					this.$message({
						message: '医院订单号、业务流水号或支付宝账户ID必须至少填其中一个！',
						duration: '2000',
						type: 'warning'
					})
					return false
				}
				this.getList();
			},
			handleSizeChange(val) {
				this.orderCancel.limit = val;
				this.getList();
			},
			handleCurrentChange(val) {
				this.orderCancel.page = val;
				this.getList();
			},
			handleCreate() {
				this.resetTemp();
				this.dialogStatus = 'create';
				this.dialogFormVisible = true;
			},
			handleUpdate(row) {
				getObj(row.id)
					.then(response => {
						this.form = response.data;
						this.dialogFormVisible = true;
						this.dialogStatus = 'update';
					});
			},
			handleDelete(row) {
				this.$confirm('此操作将永久删除, 是否继续?', '提示', {
						confirmButtonText: '确定',
						cancelButtonText: '取消',
						type: 'warning'
					})
					.then(() => {
						delObj(row.id)
							.then(() => {
								this.$notify({
									title: '成功',
									message: '删除成功',
									type: 'success',
									duration: 2000
								});
								const index = this.list.indexOf(row);
								this.list.splice(index, 1);
							});
					});
			},
			create(formName) {
				const set = this.$refs;
				set[formName].validate(valid => {
					if(valid) {
						addObj(this.form)
							.then(() => {
								this.dialogFormVisible = false;
								this.getList();
								this.$notify({
									title: '成功',
									message: '创建成功',
									type: 'success',
									duration: 2000
								});
							})
					} else {
						return false;
					}
				});
			},
			cancel(formName) {
				this.dialogFormVisible = false;
				this.dialogFormVisibleView = false;
				const set = this.$refs;
				set[formName].resetFields();
			},
			update(formName) {
				const set = this.$refs;
				set[formName].validate(valid => {
					if(valid) {
						this.dialogFormVisible = false;
						this.form.password = undefined;
						putObj(this.form.id, this.form).then(() => {
							this.dialogFormVisible = false;
							this.getList();
							this.$notify({
								title: '成功',
								message: '创建成功',
								type: 'success',
								duration: 2000
							});
						});
					} else {
						return false;
					}
				});
			},
			resetTemp() {
				this.form = {
					username: undefined,
					name: undefined,
					sex: '男',
					password: undefined,
					description: undefined
				};
			}
		}
	}
</script>
